package com.yao.sdk.net;

import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.yao.sdk.core.YaoSDK;

import java.util.Map;

/**
 * xiaolong 2015/12/1.
 */
public class NetWork {

    private static NetConfig defaultNetConfig = new NetConfig();



    private NetWork(){};

    public static void init(Context context){
        NetWorkControl.instance().init(context);
       // NetWorkControl.instance().registerNetWorkListener(new NetWorkConsole());
    }

    public static NetConfig config() {
        return defaultNetConfig;
    }

   /* public static void registerNetWorkListener(NetWorkListener listener) {
        NetWorkControl.instance().registerNetWorkListener(listener);
    }

    public static void unregisterNetWorkListener(NetWorkListener listener) {
        NetWorkControl.instance().unregisterNetWorkListener(listener);
    }*/

    public static void request(NetWorkListener listener, String url, Map<String, String> params,String token) {
        NetWorkControl.instance().request(listener, url, params,token);
    }


    public static void request(NetWorkListener listener, String url, Map<String, String> params, Map<String, String> header,String token) {
        NetWorkControl.instance().request(listener, url, params, header,token);
    }

    public static void request(NetWorkListener listener, String url, NetConfig.RequestMethod requestMethod, Map<String, String> params, Map<String, String> header,String token) {
        NetWorkControl.instance().request(listener, url, requestMethod, params, header,token);
    }
    public static void cancelRequest(Context mContext) {
        NetWorkControl.instance().cancelRequest(mContext);
    }

}
